<template>
  <div class="proDeta">
    <div class="chanpin">
      <div class="top">
        <div class="font20">产品中心</div>
        <button @click="$router.back(-1)">返回<svg-icon icon-class="cc-right"/></button>
      </div>
      <div class="proDetaCont">
          <div class="proDetaCont_p">
              <div class="lt">
                <el-carousel indicator-position="outside" height="207px">
                  <el-carousel-item v-for="item in items" :key="item">
                    <div :style="{backgroundImage: 'url(' + item + ')', backgroundSize:'cover'}"></div>
                  </el-carousel-item>
                </el-carousel>
              </div>
              <div class="rt">
                <div class="font24">{{detailInfo.productName}}</div>
                <div class="font14"><span>引荐 返{{detailInfo.yinqian}}%  <svg-icon icon-class="cc-right"/></span><span>直签 返{{detailInfo.zhiqian}}%  <svg-icon icon-class="cc-right"/></span></div>
                <p>产品介绍：{{detailInfo.detail}}</p>
              </div>
          </div>
          <div class="proDetaCont_b">
              <div class="font20">产品详情</div>
              <div class="cont" v-html="detailInfo.content">
              </div>
          </div>
      </div>
    </div>
  </div>
</template>
<script>
import { GetDetailOfProductByCompany } from "@/api/product"
export default {
  name: "home",
  data() {
    return {
      detailInfo:{},
      message: "",
      items:[
      ]
    }
  },
  created() {
    var id = this.$route.query.id
    GetDetailOfProductByCompany(id).then(res=>{
      console.log(res)
      if(res != null && res.info != null){
        this.detailInfo = res.info
        if(res.info.pictureList != null && res.info.pictureList != ''){
          this.items = res.info.pictureList.split(',')
        }
      }else{
        this.$router.push('/')
      }
    })
  }
}
</script>
<style rel="stylesheet/scss" lang="scss">
.proDeta {
  .top{
    margin-bottom: 25px;
    position: relative;
    overflow: hidden;
    .font20{
      float: left;
      color: #333333;
      font-size: 20px;
      padding-left: 15px;
      position: relative;
      line-height: 33px;
      &::after{
        content: '';
      width: 4px;
      height: 15px;
      background-color: #2f59ab;
      border-radius: 2px;
      position: absolute;
      top: 50%;
      left: 0;
      -webkit-transform: translateY(-50%);
      transform: translateY(-50%);
      }
    }
    button{
      width: 79px;
      height: 33px;
      background-color: #4985e9;
      border-radius: 3px;
      border: none;
      color: #ffffff;
      .svg-icon{
        margin-left: 5px;
      }
      float: right;
    }
  }
  .proDetaCont{
    background-color: #ffffff;
	  box-shadow: 0px 0px 8px 0px 
		rgba(43, 61, 86, 0.14);
    border-radius: 5px;
    padding: 30px;
    .proDetaCont_p{
      overflow: hidden;
      .lt{
        width: 40%;
        float: left;
        .el-carousel__item{
          div{
            display: block;
            height: 100%;
          }
        }
        .el-carousel__indicators{
          position: absolute;
          width: 100%;
          bottom: 0;
          left: 0;
          .el-carousel__indicator{
            button{
              width: 16px;
              height: 16px;
              background-color: #ffffff;
              border-radius: 50%;
              opacity: 1;
            }
            &.is-active button{
              background-color: #e64628;
            }
          }
        }
      }
      .rt{
        float: left;
        width: 60%;
        padding-left: 25px;
        .font24{
            color: #333333;
            font-size: 24px;
        }
        div.font14{
          margin: 15px 0;
          span{
            color: #ffffff;
            font-size: 14px;
            background-color: #4985e9;
            border-radius: 3px;
            padding: 5px 10px;
            display: inline-block;
            &:last-child{
              margin-left: 10px;
            }
          }
        }
        p{
          font-size: 14px;
          color: #9a9696;
          line-height: 24px;
        }
      }
    }
    .proDetaCont_b{
      margin-top: 30px;
      padding-top: 30px;
      border-top: solid 1px #d2d2d2;
      .font20{
        color: #333333;
        font-size: 20px;
        margin-bottom: 20px;
      }
      img{
        width: 100%;
      }
    }
  }
}

</style>
